package com.impzx.restaurant.rest.service;

import javax.ws.rs.POST;
import javax.ws.rs.Path;

import org.jboss.resteasy.annotations.Form;
import org.springframework.beans.factory.annotation.Autowired;

import com.impzx.restaurant.rest.dataobject.Order;
import com.zxpan.restaurant.persist.dao.OrderDao;


@Path("/order")
public class OrderService {

	@Autowired
	private OrderDao orderDao;
	
	
	@POST
	@Path("orderDish")
	public int orderDishes(@Form Order order) {
		int result = 0;
		com.zxpan.restaurant.db.model.Order dbOrder = new com.zxpan.restaurant.db.model.Order();
		
		dbOrder.setUserId(order.getUserId());
		dbOrder.setHotelId(order.getHotelId());
		dbOrder.setTableId(order.getTableId());
		dbOrder.setDishList(order.getDishList());
		dbOrder.setStatus(0);
		result = orderDao.addOrder(dbOrder);
		
		return result;
	}

}
